#version 460



#include "single_color.glsl"


 

layout(location = 0) in vec2 inPos;
layout(location = 1) in vec2 inWidget;
layout(location = 2) in vec2 inNormal;


layout(location = 0) out vec4 gColor;
layout(location = 1) out vec2 vWidget;
layout(location = 2) out vec2 vNormal;
layout(location = 3) flat out uint vInstanceIndex;

//vec2 pos[4] = {vec2(10.0, 10.0), vec2(100.0, 10.0), vec2(10.0, 100.0), vec2(100.0, 100.0)};
out gl_PerVertex {
	vec4	gl_Position;
	float	gl_PointSize;
};

void main(void){

	/*mat3x2 mat = m_LP_SD[gl_InstanceIndex];
	vec4 v = vec4(0.0, 0.0, 0.0, 1.0);
	v.xy = (inPos.xy * mat[2].x) + (mat[1] * inColor.xy);
	v.xy += mat[0];
	v.xy *= m_Scale;
	v.xy += m_Loc;
	v.z = mat[2].y;
	gl_Position = mat_ProjecView * v;*/

	vInstanceIndex = gl_InstanceIndex;
	
	gColor = f_buildColor(InstanceColor[gl_InstanceIndex]);
	
	gl_PointSize = 4.0;
	gl_Position = vec4(inPos, 0, 1);
	vWidget = inWidget;
	vNormal = inNormal;

}



